/*
 * Copyright (c) 2017, dhl and/or its affiliates. All rights reserved.
 * dhl PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 */
package com.xd.cloud.web;

import javax.servlet.http.HttpServletRequest;

import com.xd.cloud.common.Constants;
import com.xd.cloud.entity.core.User;


/**
 * 所有controller的基类，缓存用户信息
 * 
 * @author dhl
 * @since  V1.0
 * 
 */
public class BaseController {
	
	//缓存用户信息
	protected User getSessionUser(HttpServletRequest request) {
		User user = (User)request.getSession().getAttribute(Constants.USER);
		return user;
	}
	
	protected void setSessionUser(HttpServletRequest request,User user) {
		request.getSession().setAttribute(Constants.USER,user);
	}
	
}
